package com.ytjj.qmyx.mall.mapper;

import com.ytjj.qmyx.mall.model.*;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

public interface ProductMapper {
    long countByExample(ProductExample example);

    int deleteByExample(ProductExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(Product record);

    int insertSelective(Product record);

    List<Product> selectByExampleWithBLOBs(ProductExample example);

    List<Product> selectExclusive(@Param("type")Integer type);

    List<Product> selectByExample(ProductExample example);

    Product selectByPrimaryKey(Integer id);

    List<String> selectProductName();

    int selectProduct();

    ProductSpec selectSpec(Integer id);

    OrdersSpec selectSpecs(Integer orderId);


    int updateByExampleSelective(@Param("record") Product record, @Param("example") ProductExample example);

    int updateByExampleWithBLOBs(@Param("record") Product record, @Param("example") ProductExample example);

    int updateByExample(@Param("record") Product record, @Param("example") ProductExample example);

    int updateByPrimaryKeySelective(Product record);

    int updateByPrimaryKeyWithBLOBs(Product record);

    int updateByPrimaryKey(Product record);

    List<Product> queryProductListByGroup(String activityType, String plateForm, Integer userId);

    List<Product> queryQuickGroupWorkAll(String activityType, String plateForm, Integer userId);

    List<Product> queryMyGroupList(Integer userId, Integer status);

    List<Product> queryFineGroupList(String plateForm, Integer num);

    List<Product> queryFineGroupListByPage(String plateForm);

    Integer queryMyGroupNum(Integer userId);

    List<Product> queryRandomProductByActivityTypeAndLimit(@Param("activityType")String activityType, @Param("limit") Integer limit);

    Product findClassify(@Param("productId") Integer productId);

    Integer updateInfoImgById(@Param("id") Integer id,@Param("infoImgFinal") String infoImgFinal);

    Integer countBeforeNum(@Param("topCategoryId") Integer topCategoryId, @Param("volumeStr") Integer volumeStr,@Param("platformData")String platformData);

    /**
     * 根据参数获取商品
     * @param status 1 上架 2 下架  3 已删除 4 待上架 5 打回
     * @param randNum
     * @return List<Product>
     */
    List<Product> selectByParamsRandom(Integer status,Integer randNum);

    /**
     * 根据商品id查询商品分类
     */
    List<Product> getProductTopCategory(@Param("list") List<String> productIds);
}
